package com.es.test.service.query;

import co.elastic.clients.elasticsearch._types.query_dsl.MatchQuery;
import co.elastic.clients.elasticsearch._types.query_dsl.Query;
import com.es.test.query.Field;

public class MatchQueryBuilder implements QueryBuilder{
    @Override
    public Query build(Field field) {
        return MatchQuery.of(m -> m
                .field(field.getFieldName())
                .query(String.valueOf(field.getFiledValue()))
        )._toQuery();
    }
}
